using System.Collections.Generic;
using Lucene.Net.Search;

namespace NopSolutions.NopCommerce.LuceneHelper.Queries
{
    public class SpecificationOptionQuery : BaseSpecificationQuery<SpecificationOptionQuery>
    {
        public const string FIELDS_SPECIFICATION_ATTRIBUTE_OPTION_ID = "SpecOptionID";
        public const string FIELDS_SPECIFICATION_ATTRIBUTE_OPTION_NAME = "SpecOptionName";
        public const string FIELDS_SPECIFICATION_ATTRIBUTE_OPTION_DISPLAYORDER = "SpecOptionDisplayOrder";
        
        public override LuceneIndexType IndexType
        {
            get { return LuceneIndexType.SpecificaitonOptions; }
        }

        public SpecificationOptionQuery ForSpecifications(IList<int> specificationIds)
        {
            Query = JoinQueries(Query, GetQueryFromList(specificationIds, FIELDS_SPECIFICATION_ATTRIBUTE_ID,BooleanClause.Occur.SHOULD));
            return this;
        }
             
    }
}
